import UTIL from './util'
import const_dev from "./const_dev"
import const_test from './const_test'
import const_prod from './const_prod'

let CONST = {

  NAME_SUGGESTION_STATUS: ['未处理', '已拒绝', '已同意'],

  EXERCISE_GROUP_ROLE_ARRAY: ['A1/A2型题','A3/A4型题', 'B型题', '案例分析题'],
  EXERCISE_GROUP_ROLE_A1: "A1/A2型题",
  EXERCISE_GROUP_ROLE_A3: "A3/A4型题",
  EXERCISE_GROUP_ROLE_B: "B型题",
  EXERCISE_GROUP_ROLE_CASE: "案例分析题",

  KNOWLEDGE_FIELD_VALUE_JSON_TYPE_ARRAY: [2,4,5,7,8,9,10,11,12],
  KNOWLEDGE_FIELD_VALUE_DEFAULT: [
    "",     // 输入框      0
    "",     // 富文本      1
    "[]",   // 参照        2
    "",     // 单选下拉框   3
    "{\"paths\": [],\"additional\": \"\",\"comment\": \"\",\"type\": \"\",\"classification\": \"\",\"title\": \"\"}",   //图片
    "[]",   // 多选下拉框    5
    "",     // 文本域        6
    "[]",   // 多值输入框     7
    "[]",   // 关联本知识库    8
    "[]",   // 关联其它本知识库 9
    "[]",   // 关联应用平台    10
    "{\"paths\":[],\"type\":\"\",\"title\":\"\"}",   // 视频
    "[]",   // 文件           12
    ""      // h5
  ],

  FIELD_KIND_STRINGTEXT: 0,
  FIELD_KIND_RICHEDITOR: 1,
  FIELD_KIND_REFERENCE: 2,
  FIELD_KIND_DROPDOWNLIST: 3,
  FIELD_KIND_IMG: 4,
  FIELD_KIND_DROPMULTILIST: 5,
  FIELD_KIND_TEXTAREA: 6,
  FIELD_KIND_MULTI_VALUE_INPUT: 7,
  FIELD_KIND_ASSOCIATE_CURRENT_KNOWLEDGE_LIB: 8,
  FIELD_KIND_ASSOCIATE_OTHER_KNOWLEDGE_LIB: 9,
  FIELD_KIND_ASSOCIATE_PLATFORM: 10,
  FIELD_KIND_VIDEO: 11,
  FIELD_KIND_FILE: 12,
  CALCULATOR_FIELD_KIND_H5: 13,

  KNOWLEDGE_UNIT_FIELD_SELF: "无标题",
  KNOWLEDGE_UNIT_FIELD_CUSTOM_TAG_KEY: "自由标签",

  /**
   * 图书标记状态
   */
  BOOK_MARKED_STATUS_UNMARKED: 0,
  BOOK_MARKED_STATUS_MARKING: 1,
  BOOK_MARKED_STATUS_DONE: 2,

  // 项目中大量使用了window.innerHeight, 前端重构后, window.innerHeight 为document高度, 与之前工作台高度有变化
  // 重新赋值 window.innerHeight 为工作区高度;
  WORKSPACE_HEIGHT: window.innerHeight - 85,
  WORKSPACE_WIDTH: window.innerWidth - 200,
  INT_CHAR_ARRAY: ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九'],
  SERVICE_REST_PACKAGE: '/pmph/action/',
  YMER_SERVICE_REST_PACKAGE: '/ymer/action/file/showImage?filename=',
  SERVICE_URL: 'https://kms.pmphai.com',
  WORDS_SOURCE_DISPLAY: [
    '新建',
    '导入',
    '知识库',
    '术语库',
    '分类',
  ],
  //同步状态
  SYNC_STATUS: [{
    value: '0',
    label: '推送失败'
  }, {
    value: '1',
    label: '消费失败'
  }, {
    value: '2',
    label: '待推送'
  }, {
    value: '3',
    label: '推送成功'
  }],
  SYNC_STATUS_DISPLAY: [
    '推送失败',
    '消费失败',
    '未推送',
    '推送成功',
  ],
  SYNC_STATUS_WAITING: 0,
  SYNC_STATUS_SUCCESS: 1,
  SYNC_STATUS_FAILED_PRODUCER: 2,
  SYNC_STATUS_FAILED_CONSUMER: 3,
  // 富文本, 及图片字段, 图片类型选项;
  IMAGE_TYPE: [{
    value: 'rw_img table',
    label: '表格图'
  }, {
    value: 'rw_img general',
    label: '示意图'
  }, {
    value: 'rw_img picture',
    label: '插图'
  }, {
    value: 'rw_img cover',
    label: '封面图'
  }, {
    value: 'rw_img formula',
    label: '公式图'
  }, {
    value: 'rw_img flow',
    label: '流程图'
  }, {
    value: 'rw_img hnt',
    label: '行内图'
  }, {
    value: 'rw_img default',
    label: '默认分类'
  }, {
    value: 'rw_img other',
    label: '其他图'
  }],
  // 富文本, 及图片字段, 补充类型选项;
  ADDITIONAL_TYPE: [{
    value: 'color',
    label: '彩图'
  }, {
    value: 'shoot',
    label: '实拍图'
  }, {
    value: 'gif',
    label: '动图'
  }],
  // 富文本, 及图片字段, 图片分类选项;
  IMAGE_CLASSIFICATION: [{
    value: 'rtjp',
    label: '人体解剖'
  }, {
    value: 'yxyx',
    label: '医学影像'
  }, {
    value: 'lcss',
    label: '临床手术'
  }, {
    value: 'yxjc',
    label: '医学检查'
  }, {
    value: 'lczz',
    label: '临床症状'
  }, {
    value: 'lcbl',
    label: '临床病理'
  }, {
    value: 'yxgj',
    label: '医学工具'
  }, {
    value: 'bbzz',
    label: '病变组织'
  }, {
    value: 'lccz',
    label: '临床操作'
  }],
  // 富文本, 及图片字段, 图片分类选项;
  TASK_ITEM_STATUS: [{
    value: 0,
    key: '未提交'
  }, {
    value: 1,
    key: '初审中'
  }, {
    value: 2,
    key: '审核通过'
  }, {
    value: 3,
    key: '初审驳回'
  }, {
    value: 4,
    key: '复审中'
  }, {
    value: 5,
    key: '复审驳回'
  }, {
    value: 6,
    key: '终审中'
  }, {
    value: 7,
    key: '终审驳回'
  }, {
    value: 8,
    key: '已发布'
  }, {
    value: 9,
    key: '终审通过后驳回'
  }],
  //类型, 非自建(任务编辑人员创建), 自建(知识编辑人员创建), 修订
  TASK_ITEM: {
    //未提交
    STATUS_NOT_COMMIT: 0,
    //初审中
    STATUS_COMMIT: 1,
    //审核通过
    STATUS_PASS: 2,
    //初审驳回
    STATUS_REJECT: 3,
    //初审通过，复审中
    STATUS_PASS_1: 4,
    //复审驳回
    STATUS_REJECT_2: 5,
    //终审中／复审通过
    STATUS_PASS_2: 6,
    //终审驳回
    STATUS_REJECT_3: 7,
    //发布
    STATUS_RELEASED: 8,
    //最终审核通过后驳回
    STATUS_FINAL_REJECT: 9,
    TYPE_TASK_EDITOR_CREATE: 0,
    TYPE_KNOWLEDGE_EDITOR_CREATE: 1,
    TYPE_EDIT: 2,
    TYPE_TASK_EDITOR_CREATE_KNOWLEDGE_UNIT: 3,
    TYPE_EDIT_KNOWLEDGE_UNIT: 4,
  },
  TASK_ITEM_VO: ['非自建', '自建', '修订', '非自建_素材', '修订_素材'],
  TASK_ITEM_STATUS_VO: [{
      value: 0,
      label: '非自建'
    }, {
      value: 1,
      label: '自建'
    }, {
      value: 2,
      label: '修订'
    }, {
      value: 3,
      label: '非自建_素材'
    }, {
      value: 4,
      label: '修订_素材'
    }],
  KNOWLEDGE_LIB: {
    CALCULATOR_LIB_ID: 'calculator_lib_id',
    FLOW_CHART_LIB_ID: 'flow_chart_lib_id',
    BOOK_LIB_ID: 'book_lib_id',
    TERM_LIB_ID: 'term_lib_id'
  },
  SYSTEM: {
    ALL: "all",
    KNOWLEDGE_LIB: "knowledge",
    CALCULATOR: "calc",
    FLOWCHART: "flowchart",
    JOURNAL: "journal",
    BOOK: "book",
    TERM: "term"
  },
  DRUG_INFO_LIB_ID: '0001AA100000000HUKPT',
  QUESTION_AN_LIB_ID: '0001AA100000000WD711',
  // 富文本, 及图片字段, 图片分类选项;
  SYSTEM_TYPE: [{
    value: 'knowledge',
    label: '标准知识库'
  }, {
    value: 'calc',
    label: '医学计算器'
  }, {
    value: 'flowchart',
    label: '流程图'
  }, {
    value: 'journal',
    label: '期刊'
  }, {
    value: 'book',
    label: '图书'
  }, {
    value: 'term',
    label: '术语'
  }],
  JOURNAL_STATUS: [{
    value: 1,
    label: '导入失败'
  }, {
    value: 2,
    label: '导入成功'
  }],
  HISTORY_OPERATE_STATUS: [
    '提交',
    '审核通过',
    '驳回',
    '发布',
    '新建',
    '删除',
    '重新编辑',
    '恢复',
    '勘误',
  ],
  AUTHORITY_EDIT_LIST: [
    'calculator',
    'zsct',
    'liuchengtu',
    'bzsy',
    'book',
    'journal',
    'sck',
    'fldh',
    'spzgl'
  ],
  AUTHORITY_PUSH_LIST: [
    'calculator',
    'zsct',
    'book',
    'journal',
    'liuchengtu'
  ],
  TERM_PROPERTY: {
    englishName: '英文名称',
    englishAbbr: '英文简称',
    frenchName: '法文名称',
    russianName: '俄文名称',
    germanName: '德文名称',
    japaneseName: '日文名称'
  },
  TERM_STANDARD_PROPERTY: {
    synonym: '同义词',
    englishName: '英文名称',
    englishNameSynonym: '英文同义词',
    englishAbbr: '英文缩写',
    englishAbbrSynonym: '英文缩写同义词',
    frenchName: '法文名称',
    frenchNameSynonym: '法文同义词',
    russianName: '俄文名称',
    russianNameSynonym: '俄文同义词',
    germanName: '德文名称',
    germanNameSynonym: '德文同义词',
    japaneseName: '日文名称',
    japaneseNameSynonym: '日文同义词'
  },
  TERM_ITEMS: [
    {
      id: '1',
      name: "术语正名",
      selected: true,
    },
    {
      id: '2',
      name: "英文名称",
      selected: false,
    },
    {
      id: '3',
      name: "英文简称",
      selected: false,
    },
    {
      id: '4',
      name: "同义词",
      selected: false,
    },
    {
      id: '5',
      name: "法文名称",
      selected: false,
    },
    {
      id: '6',
      name: "俄文名称",
      selected: false,
    },
    {
      id: '7',
      name: "德文名称",
      selected: false,
    },
    {
      id: '8',
      name: "日文名称",
      selected: false,
    },
    {
      id: '9',
      name: "释义",
      selected: false,
    },
    {
      id: '10',
      name: "术语来源",
      selected: false,
    }
  ],
  TERM_SOURCE: {
    0: '一级来源：名词委员会',
    1: '二级来源：卫健委发布标准',
    2: '三级来源：教材',
    3: '四级来源：专著'
  },
  TERM_BOOK_CATEGORY: [{
    value: 0,
    label: '名词委员会'
  }, {
    value: 1,
    label: '卫健委发布标准'
  }, {
    value: 2,
    label: '教材'
  }, {
    value: 3,
    label: '专著'
  }],
  TERM_RULE_ID: {
    termRuleId: '18'
  },
  NEW_MEDIA_LIB_ID: '0001AA100000000X76U6',
  EVENT_RESULT: [{
    value: '成功',
    label: '成功'
  }, {
    value: '失败',
    label: '失败'
  }],
  USER_TYPE: [{
    value: 0,
    label: '社外'
  }, {
    value: 1,
    label: '社内'
  }],
  SOURCE: {
    0: '导入',
    1: '新建'
  },
  BOOK_TYPE: [{
    value: 0,
    label: '电子书'
  }, {
    value: 1,
    label: '电子书+增值服务'
  }, {
    value: 2,
    label: '增值服务'
  }],
  BOOK_QUALITY_STATUS: {
    1: '未付型',
    2: '已付型'
  },
}
if (process.env.NODE_ENV === 'production') {
  CONST.ENV = const_prod
} else if (process.env.NODE_ENV === 'test') {
  CONST.ENV = const_test
} else {
  CONST.ENV = const_dev
}
UTIL.recursiveFreeze(CONST)
export default CONST
